home *** CD-ROM | disk | FTP | other *** search
/ X User Tools / X User Tools (O'Reilly and Associates)(1994).ISO / sun4c / archive / tcltk.z / tcltk / man / catn / lsearch.n < prev    next >
Text File  |  1994-09-20  |  2KB  |  67 lines

  1.  
  2.  
  3.  
  4. lsearch(n)            Tcl Built-In Commands                   7.0
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NAME
  11.      lsearch - See if a list contains a particular element
  12.  
  13. SYNOPSIS
  14.      lsearch ?_m_o_d_e? _l_i_s_t _p_a_t_t_e_r_n
  15. _________________________________________________________________
  16.  
  17.  
  18. DESCRIPTION
  19.      This command searches the elements of _l_i_s_t to see if one  of
  20.      them  matches _p_a_t_t_e_r_n.  If so, the command returns the index
  21.      of the first matching element.  If not, the command  returns
  22.      -1.   The  _m_o_d_e  argument  indicates how the elements of the  |
  23.      list are to be matched against _p_a_t_t_e_r_n and it must have  one  |
  24.      of the following values:                                      |
  25.  
  26.      -exact                                                             ||
  27.           The  list  element must contain exactly the same string  |
  28.           as _p_a_t_t_e_r_n.                                              |
  29.  
  30.      -glob                                                              ||
  31.           _P_a_t_t_e_r_n  is  a  glob-style  pattern  which  is  matched  |
  32.           against each list element using the same rules  as  the  |
  33.           string match command.                                    |
  34.  
  35.      -regexp                                                            ||
  36.           _P_a_t_t_e_r_n  is treated as a regular expression and matched  |
  37.           against each list element using the same rules  as  the  |
  38.           regexp command.                                          |
  39.  
  40.      If _m_o_d_e is omitted then it defaults to -glob.
  41.  
  42.  
  43. KEYWORDS
  44.      list, match, pattern, regular expression, search, string
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. Tcl                                                             1
  64.  
  65.  
  66.  
  67.